
pkgname=efivar
_pkgname=vathpela-efivar
_commit=70e63d4
pkgver=35
pkgrel=1
pkgdesc="Library to manipulate EFI variables"
arch=('x86_64')
url="https://github.com/rhinstaller/efivar"
license=('LGPL2.1')
depends=('popt')
options=('zipman' 'docs' '!makeflags')
source=("https://github.com/rhinstaller/efivar/releases/download/${pkgver}/efivar-${pkgver}.tar.bz2"
        'compiler.patch')
md5sums=('53da18ea0cf7bba1fd9edf3098037edf'
         '76d1d1cc85f021ea9d820395af8fa8d4')

build() {
	cd ${pkgname}-${pkgver}/
	#patch -p1 -i $srcdir/compiler.patch
	
	unset CFLAGS
	unset CPPFLAGS
	unset CXXFLAGS
	unset LDFLAGS
	unset MAKEFLAGS
	
	sed 's|-rpath=$(TOPDIR)/src/|-rpath=$(libdir)|g' -i ${srcdir}/${pkgname}-${pkgver}/src/test/Makefile || true
	sed 's|-O0|-Os|g' -i "${srcdir}/efivar/Make.defaults" || true
	
	make libdir="/usr/lib/" bindir="/usr/bin/" mandir="/usr/share/man/" includedir="/usr/include/" V=1 -j1
	echo
}

package() {
	
	cd ${pkgname}-${pkgver}/
	
	make -j1 V=1 DESTDIR=${pkgdir}/ libdir="/usr/lib/" bindir="/usr/bin/" mandir="/usr/share/man/" includedir="/usr/include/" install
	echo
	
	#rm ${pkgdir}/usr/bin/efivar-static
}
